#!/bin/sh

# 下载常用的docker镜像

# 下载  nginx1.22.1
# 下载  php7.4.33
# 下载  mysql5.7.16
# 下载  mongo6.0.3
# 下载  redis6.2.8
# 下载  node18.14.2
# 下载  go1.20.1-bullseye

which docker

if [ $? -eq 1 ]
then
    echo "请安装docker"
    exit
fi

format(){
    printf "Pull %+7s:%s\n" $1 $2
}

format "nginx" "1.22.1"
docker pull magein/nginx:1.22.1 > /dev/null 2>&1

format "php" "7.4.33"
docker pull magein/php-fpm-alpine3.6:7.4.33 > /dev/null 2>&1

format "mysql" "5.7.16"
docker pull mysql:5.7.16 > /dev/null 2>&1

format "redis" "6.2.8"
docker pull redis:6.2.8 > /dev/null 2>&1

format "mongo" "6.0.3"
docker pull mongo:6.0.3 > /dev/null 2>&1

format "node" "18.14.2"
docker pull node:18.14.2 > /dev/null 2>&1

format "go" "latest"
docker pull golang:latest > /dev/null 2>&1